package com.example.jl.bethinner.activity;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import com.example.jl.bethinner.R;
import com.example.jl.bethinner.base.BaseActivity;
import com.example.jl.bethinner.view.RadarView;

public class ScanRadarActivity extends BaseActivity implements OnClickListener {
    RadarView radarView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scan_radar);
        radarView = (RadarView) findViewById(R.id.scan_radar);
        radarView.setOnClickListener(this);
        findViewById(R.id.button).setOnClickListener(this);
        findViewById(R.id.fail_button).setOnClickListener(this);
        findViewById(R.id.start_button).setOnClickListener(this);

    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.scan_radar:
                radarView.start();
                break;
            case R.id.button:
                radarView.stopOrRestart();
                break;
            case R.id.fail_button:
                radarView.scandFailed();
                break;
            case R.id.start_button:
                radarView.start();
                break;
        }
    }
}
